class: title-slide, left, bottom
# Patient Experience Dashboard — Summary ---- ## **Strengths, Weakness, Improvements** ### Vishal Sharma | September 2022 --- name: contents class: inverse # CONTENTS 1. [Introduction](#introduction) 2. [Assumptions](#assumptions) 3. [Strengths](#strengths) 4. [Weaknesses](#weaknesses) 5. [Improvements](#improvements) 6. [References](#references) 7. [Acknowledgement](#acknowledgment) --- name: introduction # INTRODUCTION The patient experience dashboard is a part of [NHS Patient Experience Framework](https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/215159/dh_132788.pdf). The framework outlines eight critical elements for patients' experience of NHS Service: * Respect for patient-centered values, preferences, and expressed needs * Coordination and integration of care * Information, communication, and education * Physical comfort * Emotional support * Welcoming the involvement of family and friends * Transition and continuity * Access to care Patient Experience Dashboard offers insight into patients' perspectives on the quality, effectiveness, and promptness of care. By displaying patient experience data in one place, the Patient Experience Dashboard makes it easy for NHS staff to check in on patient experience and address problem areas as they arise. These patient insights are helpful in short- and long-term planning and can prove particularly critical as part of a hospital's quality improvement efforts. This presentation aims to highlight the strengths, weaknesses, and improvements in the existing patient experience dashboard by NHS CDU Data Science Team. --- name: assumptions # ASSUMPTIONS * FTT expands to Friends & Family Test * The data is gathered from feedback form after the patient's treatment * For each value of category, a comments section is provided to input manual comments * Not sure about the calculation & meaning of the *Criticality* field on *Themes/Weighting - Comments* tab * *'What could be improved?'* & *'What did we do well?'* are categorical variables with the checkbox input * The intended audience for this dashboard is the departmental leaders and trust leaders of NHS * NHS CDU Data Science team follows NHS branding guidelines ## Target Questions * How do patients rate their satisfaction with each department? * Do the results indicate that expected outcomes are acheived? * What are the key areas of improvements in every division/directorate/department? * Are service users and their families engaged in improving patient experience? .footnote[ **Footnotes** * The R expressions/keywords are represented like `this` * The keywords related to data or dashboard are represented in *italics* * The errors are represented with .red[red color] ] --- name: strengths # STRENGTHS ## In terms of UI * Flexibility to filter data based on *Division*, *Directorate*, *Team*, and *Date range* * All tabs in the dashboard responds to the sidebar filters (context filters) * X-bar chart of Friends & Family test to determine the stability in average FFT score over time * Ability to download the report with the flexibility to include/exclude required details and period of analysis * The reactive filtering of metrics based on the above criterion with immediate effect and no dependency on any button * Appropriate color coding in *Criticality* field for better understanding * Flexibility to adjust the graph in *Themes/Weighting - Timeline* tab based on *Total* & *Proportions* * Identification of sentiments for each comment which can help the user not to read the entire comment and save time * Filter comments based on category & sentiments * Ability to search comments based on keywords * Representation of the count of comments based on diversity * Snapshot of data uploaded on the dashboard using *Upload* button --- name: strengths2 # STRENGTHS - continued... ## In terms of code * The modular structure of the application enhances scalability * Implementation of `golem` package provides robustness and simplification of creation, development, and deployment of a shiny application * The entire code follows standards and code of conduct which enables the rationalisation of code in multiple contributors * Every call to the function is referenced from its namespace, which will allow the app to identify the function at run time * Reusability of `ui` and `server` functions for example `mod_text_reactable_ui` & `mod_click_tables_ui` are used for both the cases *'What could be improved?'* & *'What did we do well?'* * Usage of the `golem-config.yml` file to re-use the same code for different trusts like *'trust-a'*, *'trust-b'*, etc * The use of `isTruthy()` function from the `shiny` package can handle run time discrepancies in conditions * Interesting utility functions like `rv()` for `reactiveValues()` and `rvtl()` for `reactiveValuesToList()` * The use of namespaces `ns()` function to ensure that none of the IDs collide --- name: weaknesses # WEAKNESSES * Time to initial load * Readability in charts (small fonts, title, labels, etc) * Formatting of downloaded report * Error in the comments section: .red[Too many comments] in report * The visualisations should be self explainable * The numbers should be validated across the dashboard * Caching of visualisations and render functions * Date range adjustment in timeline charts or xbar chart * Session timeout/disconnection (based on user need) --- name: improvements # IMPROVEMENTS ## Summary tab * The summary tab can be renamed to *'Overview'* * The new *'Overview'* tab can show a glimpse of the overall dashboard with the visualisation from other tabs as well * The numbers can be comma separated, i.e., instead of *'There are 27401 comments in the database from 26373 individuals.'* we can show *'There are 27,401 comments in the database from 26,373 individuals.'* * The simple text can be replaced with `valueBox`  --- name: improvements2 # IMPROVEMENTS - continued... ## Report Builder tab * The report builder tab is a utility hence it can be moved to a `controlBar` (on the right side of the dashboard) <img src="data:image/png;base64,#www/Sidebar.PNG" width="300px" height="370px" style="display: block; margin: auto;" /> --- name: improvements3 # IMPROVEMENTS - continued... ## Report Builder tab * The downloaded report should be in pdf format (using LaTeX) * The tables should be formatted in the report, and formatting here includes the names of the columns as well (instead of *'n'* and *'percent'*, we can say *'Count'* and *'Percentage'*) <table class="table table-bordered" style="font-size: 15px; margin-left: auto; margin-right: auto;"> <thead> <tr> <th style="text-align:left;"> Category </th> <th style="text-align:left;"> Count </th> <th style="text-align:left;"> Percentage </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;width: 2.5cm; border-right:1px solid;"> Couldn’t be improved </td> <td style="text-align:left;width: 1.5cm; border-right:1px solid;"> 2,818 </td> <td style="text-align:left;width: 2cm; "> 42.1% </td> </tr> <tr> <td style="text-align:left;width: 2.5cm; border-right:1px solid;"> Care received </td> <td style="text-align:left;width: 1.5cm; border-right:1px solid;"> 2,269 </td> <td style="text-align:left;width: 2cm; "> 33.9% </td> </tr> <tr> <td style="text-align:left;width: 2.5cm; border-right:1px solid;"> Miscellaneous </td> <td style="text-align:left;width: 1.5cm; border-right:1px solid;"> 505 </td> <td style="text-align:left;width: 2cm; "> 7.5% </td> </tr> <tr> <td style="text-align:left;width: 2.5cm; border-right:1px solid;"> Staff </td> <td style="text-align:left;width: 1.5cm; border-right:1px solid;"> 380 </td> <td style="text-align:left;width: 2cm; "> 5.7% </td> </tr> <tr> <td style="text-align:left;width: 2.5cm; border-right:1px solid;"> Communication </td> <td style="text-align:left;width: 1.5cm; border-right:1px solid;"> 356 </td> <td style="text-align:left;width: 2cm; "> 5.3% </td> </tr> <tr> <td style="text-align:left;width: 2.5cm; border-right:1px solid;"> Access </td> <td style="text-align:left;width: 1.5cm; border-right:1px solid;"> 203 </td> <td style="text-align:left;width: 2cm; "> 3% </td> </tr> <tr> <td style="text-align:left;width: 2.5cm; border-right:1px solid;"> Environment/ facilities </td> <td style="text-align:left;width: 1.5cm; border-right:1px solid;"> 136 </td> <td style="text-align:left;width: 2cm; "> 2% </td> </tr> <tr> <td style="text-align:left;width: 2.5cm; border-right:1px solid;"> Transition/coordination </td> <td style="text-align:left;width: 1.5cm; border-right:1px solid;"> 16 </td> <td style="text-align:left;width: 2cm; "> 0.2% </td> </tr> <tr> <td style="text-align:left;width: 2.5cm; border-right:1px solid;"> Dignity </td> <td style="text-align:left;width: 1.5cm; border-right:1px solid;"> 6 </td> <td style="text-align:left;width: 2cm; "> 0.1% </td> </tr> </tbody> </table> --- name: improvements4 # IMPROVEMENTS - continued... ## Report Builder tab * Error in comments section: .red[Error. Too many comments. Please reduce your selection]  * The graphs should be ordered and well formatted in the report --- name: improvements5 # IMPROVEMENTS - continued... ## FFT tab * The FFT chart should have custom options to adjust the timeline * Readability of the graph can be improved * The graph can be more granular (on month or quarter basis) * The graph can have the legends <a href="https://codepen.io/vishalsharma3003/full/bGMGmXY"><img src="https://raw.githubusercontent.com/vishalsharma3003/PatientExperienceDashboardPresentation/main/www/XBarFFT.PNG" width="800" height="350"></a> <!-- [](https://codepen.io/vishalsharma3003/full/bGMGmXY) --> --- name: improvements6 # IMPROVEMENTS - continued... ## Themes/Weighting tab * The nested tabs are not a good option * The *Summary* tab can have formatted tables (like comma-separated numbers and appropriate column names) * The tables can have export options instead of multiple buttons
--- name: improvements7 # IMPROVEMENTS - continued... ## Themes/Weighting tab * Placeholders should be there in text fields * The comments tab loads twice, which is not user-friendly; possible modifications can be the argument `init = TRUE` in `observeEvent()` function or the use of `bindCache()` with `renderReactable()` * *Comments* section takes a lot of time to load; the use of dplyr can be replaced with base r as it is much more efficient ```r # dplyr approach table_comments <- tidy_trust_data_r() %>% tidyr::drop_na(crit) %>% dplyr::filter(comment_type == comment_select) %>% dplyr::select(comment_txt, crit) # base R approach table_comments <- tidy_trust_data_r()[!is.na(tidy_trust_data_r()$crit) & tidy_trust_data_r()$comment_type == comment_select, c("comment_txt", "crit")] ``` --- name: improvements8 # IMPROVEMENTS - continued... ## Themes/Weighting tab * A better visualisation can be used in the *Timeline* tab * The labels on the graph can be improved <img src="data:image/png;base64,#www/TimelineGraph.PNG" width="700px" height="400px" /> --- name: improvements9 # IMPROVEMENTS - continued... ## Sentiment tab * The *Comments* tab can contain word clouds excluding stop words
--- name: improvements10 # IMPROVEMENTS - continued... ## Sentiment tab * The sentiments can be represented with emoticons * One histogram for review length, which can highlight the engagement & participation of patients in providing reviews * Bar chart for reviews per division/department can highlight if any department requires more reviews from patients * Unigram and bigram analysis without stop words * Sentiments classification for every department * In the *Timeline* tab, black box on the lower left side --- name: improvements11 # IMPROVEMENTS - continued... ## Demographics tab * *Unknown* category should be available in the dropdown if it is included in the graph * Flexibility for count and proportions can be made available here as well * The graphs can be well formatted, and branding should be followed * Age & count chart has *12000* trimmed * The graphs should be ordered either in ascending or descending order * The text shows *There is a total of 52744 responses in your selection*, but the *'Summary'* tab shows *There are 27401 comments in the database from 26373 individuals.*. The number in *'Demographics'* tab is twice that of *'Summary'* tab --- name: improvements12 # IMPROVEMENTS - continued... ## Overall * `tabPanel` can be used within `navbarPage` for better UI. For example:  * Placeholders on all search fields * Every graph should have an appropriate title and legends to explain the information represented by the graph * Nested tab panels should be avoided * The entire dashboard should follow branding as suggested by NHS (https://www.england.nhs.uk/nhsidentity/identity-guidelines/service-branding/) * Bookmark option can be included based on user requirements * The graphs should be ordered either in ascending or descending order --- name: improvements13 # IMPROVEMENTS - continued... ## Overall * All the numbers should be well formatted with commas as required * Caching should be implemented to make the performance better * When the website loads, the upload button waits till the entire code is executed * Refresh after uploading the file? * Sentiment functions other than `calc_sentiment()` were only used once. It depreciates the goal of creating a function. The same is valid for several other functions like `tidy_all_trusts()`, `plot_fft_spc()`, etc * The dashboard title in the browser can be changed from *experiencesdashboard* to *Patient Experience Dashboard* * Collapsible bar should show icons in collapsed version * Shiny proxy with docker can be used to avoid disconnection/timeout * Sorting option available in datatables, but the option is not visible * `tryCatch()` can be used in `reactive` data frames to avoid any run time errors * Validation of input after a new file is uploaded * `groundhog` package can be to tackle the discrepancies in various dependencies of the application (http://datacolada.org/95) --- name: improvements14 # IMPROVEMENTS - continued... ## Overall * `Base R` is much more efficient then `dplyr` ```r # Simple dplyr operation DplyrExpression <- rlang::parse_expr(paste0("mtcars %>% tidyr::drop_na(cyl) %>% dplyr::filter(mpg >= 15) %>% dplyr::select(mpg, cyl, disp, hp)")) # Same operation in base R BaseRExpression <- rlang::parse_expr(paste0("mtcars[!is.na(mtcars$cyl) & mtcars$mpg >= 15, c('mpg', 'cyl', 'disp', 'hp')]")) # Comparison microbenchmark::microbenchmark(eval(DplyrExpression), eval(BaseRExpression), times = 100) ``` ``` ## Unit: microseconds ## expr min lq mean median uq ## eval(DplyrExpression) 7765.801 8094.6500 9437.71797 8434.901 9741.3010 ## eval(BaseRExpression) 47.402 55.9015 82.27394 83.400 99.8505 ## max neval ## 26925.101 100 ## 203.202 100 ``` --- name: references # REFERENCES * https://pubmed.ncbi.nlm.nih.gov/31682393/ * https://www.gp-patient.co.uk/surveysandreports * https://www.nhs.uk/using-the-nhs/about-the-nhs/friends-and-family-test-fft/ * https://www.england.nhs.uk/improvement-hub/wp-content/uploads/sites/44/2017/11/Patient-Experience-Guidance-and-Support.pdf * https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/215159/dh_132788.pdf * https://www.clearpointstrategy.com/dashboards/patient-satisfaction-measurement-dashboard/ * https://www.england.nhs.uk/nhsidentity/identity-guidelines/ * https://towardsdatascience.com/a-complete-exploratory-data-analysis-and-visualization-for-text-data-29fb1b96fb6a --- class: inverse name: acknowledgment # ACKNOWLEDGEMENTS Acknowledgments: the professional look of this presentation, using NHS and Nottinghamshire Healthcare NHS Foundation Trust colour branding, exists because of the amazing work of Silvia Canelón, details of the workshops she ran at the [NHS-R Community conference](https://spcanelon.github.io/xaringan-basics-and-beyond/index.html), Milan Wiedemann who created the CDU Data Science logo with the help of the team and Zoë Turner for putting together the slides. [<svg viewBox="0 0 512 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path></svg> @DataScienceNott](https://twitter.com/DataScienceNott) [<svg viewBox="0 0 496 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg> Clinical Development Unit Data Science Team](https://github.com/CDU-data-science-team) [<svg viewBox="0 0 512 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M440 6.5L24 246.4c-34.4 19.9-31.1 70.8 5.7 85.9L144 379.6V464c0 46.4 59.2 65.5 86.6 28.6l43.8-59.1 111.9 46.2c5.9 2.4 12.1 3.6 18.3 3.6 8.2 0 16.3-2.1 23.6-6.2 12.8-7.2 21.6-20 23.9-34.5l59.4-387.2c6.1-40.1-36.9-68.8-71.5-48.9zM192 464v-64.6l36.6 15.1L192 464zm212.6-28.7l-153.8-63.5L391 169.5c10.7-15.5-9.5-33.5-23.7-21.2L155.8 332.6 48 288 464 48l-59.4 387.3z"></path></svg> cdudatascience@nottshc.nhs.uk](mailto:cdudatascience@nottshc.nhs.uk)